var pinyin = require("pinyin");

exports.firstLetter = function (str, o) {

    if (!str) {

        return "";
    }

    var w = [];
    var pyArray = pinyin(str, {
        style: pinyin.STYLE_FIRST_LETTER
    })

    pyArray.forEach(function (wordArray) {

        var word = wordArray[0];

        w.push(word);

    }, this);
    return w.join("").toLowerCase();
}